package fmse.uaic.k.tests;

import static org.junit.Assert.*;

import org.junit.Test;

import fmse.uaic.k.configuration_abstraction.data_structures.ConfigurationKTree;
import fmse.uaic.k.configuration_abstraction.data_structures.RuleKTree;
import fmse.uaic.k.configuration_abstraction.exceptions.NotDeclaredLabelException;
import fmse.uaic.k.xml.adapter.XmlToKAbstractTree;

public class TestLabelDeclaration {

	@Test
	public final void testCheckLabelsDeclarations() {
		
		XmlToKAbstractTree convertor = new XmlToKAbstractTree();
		
		ConfigurationKTree config = convertor
				.loadConfiguration("/Users/andreiarusoaie/Documents/workspace/contextual-transformers/configuration-abstraction/src/fmse/uaic/k/resources/configuration.xml");
		// config.print();
		assertTrue(config != null);

		RuleKTree rule = convertor
				.loadRule("/Users/andreiarusoaie/Documents/workspace/contextual-transformers/configuration-abstraction/src/fmse/uaic/k/resources/rule8.xml");
		// rule.print();
		assertTrue(rule != null);
		
		
		try {
			rule.checkLabelsDeclarations(config);
		} catch (NotDeclaredLabelException e) {
			// TODO Auto-generated catch block
			System.out.println(e);
			assertTrue(true);
		}

	}

}
